package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author : 黑渊白花
 * @date : 2024/2/29 22:45
 */
@Mapper
public interface FlavorMapper {

    void insertBatch(List<DishFlavor> flavors);

    /**
     * 根据菜品ID列表批量删除收藏记录
     * @param dishIds 菜品ID列表
     * @return 影响的行数
     */
    int batchDeleteByDishIds(@Param("dishIds") List<Long> dishIds);

    @Select("select * from dish_flavor where dish_id = #{id}")
    List<DishFlavor> getByDishId(Long id);
}

